<include file="Public:header" />
<style>
table tbody tr{cursor:move;}
</style>
<div class="wrapper wrapper-content " >
	<include file="Public:alert" />
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
            	<div class="ibox-content">
					<div class="title-bar" style="margin-bottom:10px;border-bottom:1px solid #e3e3e3;padding-top:0px;padding-left:0px;">
						<div class="row  clearfix" id="title-hide">
							<ul class="breadcrum pull-left" style="font-size:14px;font-weight:700">
								{:L('SEND_BOX_SET')}
							</ul>
							<div class="pull-right">
								<a href="javascript:void(0);" id="add" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> {:L('ADD_SEND_BOX')}</a>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-sm-12">
							<table class="table table-hover table-striped table_thead_fixed" width="95%" border="0" cellspacing="1" cellpadding="0">
								<notempty name="smtplist">
									<thead>
										<tr>
											<th width="15%">&nbsp;{:L('SEND_BOX')}</th>
											<th width="20%">{:L('EMAIL_ADDRESS')}</th>
											<th width="25%">{:L('SMTP_SERVER_ADDRESS')}</th>
											<th width="20%">{:L('OPERATING')}</th>
										</tr>
									</thead>
									<tfoot>
										<tr>
											<td colspan="5">
												<!-- <div class="span8"><span style="color: rgb(243, 40, 12);">{:L('HINT')}</span></div> -->
											</td>
										</tr>
									</tfoot>
									<tbody>
										<volist name="smtplist" id="vo">
											<tr>
												<td>&nbsp;{$vo.name}</td>
												<td>{$vo.smtp.MAIL_ADDRESS}</td>
												<td>{$vo.smtp.MAIL_SMTP}</td>
												<td>
													<a href="javascript:void(0);" rel="{$vo['smtp_id']}" class="edit">{:L('EDITING')}</a>&nbsp;&nbsp;
													<a href="{:U('email/smtpdelete','smtp_id='.$vo['template_id'])}" >删除</a>
												</td>
											</tr>
										</volist>
									</tbody>
								<else />
									<tr>
										<td><include file="Public:nodata" /></td>
									</tr>
								</notempty>
							</table>
						</div> 
					</div>
            	</div>
            </div>
        </div>
    </div>
</div>
<div style="display:none;" id="dialog-add" title="{:L('ADD_STATE')}">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<div style="display:none;" id="dialog-edit" title="{:L('MODIFY_STATE')}">
	<div class="spiner-example">
		<div class="sk-spinner sk-spinner-three-bounce">
			<div class="sk-bounce1"></div>
			<div class="sk-bounce2"></div>
			<div class="sk-bounce3"></div>
		</div>
	</div>
</div>
<script type="text/javascript">	
$("#dialog-add").dialog({
	autoOpen: false,
	modal: true,
	width: 600,
	maxHeight: 400,
	position: ["center",100],
	buttons: { 
		"确认": function () {
			$('#smtpadd1').submit();
			//$(this).dialog("close");
		},
		"取消": function () {
			$(this).dialog("close");
		}
	}
});
$("#add").click(function(){
		$('#dialog-add').dialog('open');
		$('#dialog-add').load('{:U("email/smtpadd")}');
	});
</script>	
<script type="text/javascript">	

$("#dialog-edit").dialog({
	autoOpen: false,
	modal: true,
	width: 600,
	maxHeight: 400,
	position: ["center",100],
	buttons: { 
		"确认": function () {
			$('#smtpedit').submit();
			//$(this).dialog("close");
		},
		"取消": function () {
			$(this).dialog("close");
		}
	}
});
$(function(){
	$("#check_all").click(function(){
		$("input[class='list']").prop('checked', $(this).prop("checked"));
	});
	
	$(".edit").click(function(){
		var id = $(this).attr('rel');
		$('#dialog-edit').dialog('open');
		$('#dialog-edit').load('{:U("email/smtpedit","id")}'+id);
	});
})
</script>
<include file="Public:footer" />